<%@ page import="com.example.servlet.LoginServlet" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>柒捌玖|登录</title>
    <link rel="stylesheet" href="LoginAndRegister.css">
</head>
<body>
<header>
    <div class="header-line"></div>
</header>
<div class="carousel-background">

</div>
<div class="content">
    <img class="content-logo" src="image/SevenEightWineLogo.png" alt="logo">
    <h1 class="content-title">登录</h1>
    <div class="content-form">
        <form action="login" method="post">
            <div id="change_margin_1">
                <label for="username"></label><input class="user" type="text" id="username" name="username" placeholder="请输入用户名">
                <%
                    String nullUsername = (String) session.getAttribute("nullUsername");

                    if(nullUsername==null)
                    {

                    }else{
                %>
                <p id="remind_username" style="color: red;"><%=nullUsername%></p>
                <%
                    }
                   %>
            </div>

            <div id="change_margin_2">
                <label for="password"></label><input class="password" type="password" id="password" name="password" placeholder="请输入密码">
                <%
                    String nullPassword = (String) session.getAttribute("nullPassword");

                    if(nullPassword==null)
                    {

                    }else{
                %>
                <p id="remind_password" style="color: red;"><%=nullPassword%></p>
                <%
                    }

                %>
            </div>

            <div>
                <%
                    try {
                        String id = (String) session.getAttribute("warn");
                        if (!id.equals("管理员")) {
                %>
                <p><%=session.getAttribute("warn")%></p>
                <%
                } else {
                %>
                <p></p>
                <%
                        }
                    } catch (NullPointerException e) {
                    }
                %>
            </div>
            <div id="change_margin_3">
                <input class="content-form-signup" type="submit" value="登录">
            </div>
        </form>
    </div>
    <div class="content-login-description">没有账户？</div>
    <div><a class="content-login-link" href="register.jsp">注册</a></div>
</div>
<script src="LoginAndRegister.js"></script>
</body>
</html>